-
Notifications
You must be signed in to change notification settings - Fork 7.7k
fix(spi): Correct SPI mapping for ESP32S2 #11510
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
👋 Hello P-R-O-C-H-Y, we appreciate your contribution to this project! 📘 Please review the project's Contributions Guide for key guidelines on code, documentation, testing, and more. 🖊️ Please also make sure you have read and signed the Contributor License Agreement for this project. Click to see more instructions ...
Review and merge process you can expect ...
|
Test Results 76 files 76 suites 13m 5s ⏱️ Results for commit 21d3e75. ♻️ This comment has been updated with latest results. |
Memory usage test (comparing PR against master branch)The table below shows the summary of memory usage change (decrease - increase) in bytes and percentage for each target.
Click to expand the detailed deltas report [usage change in BYTES]
|
Description of Change
This pull request refines SPI bus handling for ESP32S2 by correcting SPI bus mappings, and adds error handling for SPI initialization failures.
Updates to SPI bus definitions and mappings:
cores/esp32/esp32-hal-spi.c
: Adjusted SPI bus mappings for ESP32S2, reducingSPI_COUNT
from 3 to 2 and updating index definitions for clock, MISO, MOSI, and SS pins. [1] [2]cores/esp32/esp32-hal-spi.h
: Revised SPI bus definitions for ESP32S2 and other targets, aligning bus identifiers (FSPI
,HSPI
) with their intended functionality.Error handling improvements:
cores/esp32/esp32-hal-spi.c
: Added error logging for invalid SPI bus index inspiStartBus
.libraries/SPI/src/SPI.cpp
: Enhanced error handling inSPIClass::begin
by logging failures when SPI bus initialization fails.Initialization logic improvements:
libraries/SD/src/SD.cpp
: Added a check to ensurespi.begin()
succeeds before proceeding with SD card initialization. Returnsfalse
if SPI initialization fails.Tests scenarios
Tested with SD SPI example, using SPI 0 (FSPI) and SPI 1 (HSPI) with PSRAM enabled/disabled.
Related links
Closes #10079